<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body >
<p class="title" align="center" id="project_company"><!--四川国泰民安科技有限公司--></p>
<p class="title" align="center" id="project_name"><!--中国石油四川石化有限公司自备电站锅炉脱硝改造项目--></p>

<table align="center" border="1" style="border-collapse:collapse;" id="tableId">
</table>

<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(function() {
        let str=location.href; //取得整个地址栏
        let num=str.indexOf("?")
        let param=str.substr(num+4);
        getDate();
        function getDate() {
            $.ajax({
                type: "get",//请求方式
                url: 'https://www.faith-safety.com/reportVerfication/service/demo/rvQrcode/queryByIdStr?id='+param,//请求的url
                dataType: "jsonp",
                jsonp: "callback",
                jsonpCallback:"handler",
                error:function(e){
                    console.log(e)
                },
                success: function(result) {//响应成功执行的
                    console.log(result)
                    document.getElementById('project_company').innerHTML = result.entrustingCompany;
                    document.getElementById('project_name').innerHTML = result.entrustingProject;
                    $("#tableId").html("");

                    $('#tableId').append(
                        '<tr>' +
                            '<td class="label">报告编号:</td>' +
                            '<td>' + result.reportNo + '</td>' +
                            '<td class="label">报告日期:</td>' +
                            '<td>' + result.reportDate + '</td>' +
                        '</tr>'+
                        '<tr>' +
                            '<td class="label">项目名称:</td>' +
                            '<td>' + result.entrustingProject + '</td>' +
                            '<td class="label">项目业主:</td>' +
                            '<td>' + result.entrustingCompany + '</td>' +
                        '</tr>'+
                        '<tr>' +
                            '<td class="label">创建人:</td>' +
                            '<td>' + result.createBy + '</td>' +
                            '<td class="label">创建时间:</td>' +
                            '<td>' + result.createTime + '</td>' +
                        '</tr>'
                    )
                }
            });
        }
    });
</script>
<style>
    table{
        width: 70%;
    }
    p.title{
        font-family:"Times New Roman",Times,serif;
        font-weight: bold;
        font-size: xx-large;
        align-content: center;
    }
    .label {
        font-weight: bold;
        width: 100px;
    }
</style>
</body>
</html>
